package pers.cz.codegen.enums;

/**
 * @program: Jef-code-generator
 * @description: Spring注解枚举类
 * @author: Cheng Zhi
 * @create: 2023-05-12 09:59
 **/
public enum ClassAnnotationEnum implements AnnotationEnum{

    /**
     * 声明为Bean交由IOC容器管理
     */
    COMPONENT("Component", "@Component "),

    /**
     * 声明为一个数据访问层Bean对象并交由IOC容器管理
     */
    REPOSITORY("Repository", "@Repository "),

    /**
     * 声明为一个业务Bean对象并交由IOC容器管理
     */
    SERVICE("Service", "@Service"),

    /**
     * 声明为一个Controler
     */
    CONTROLLER("Controller", "@Controller"),

    /**
     * Bean对象销毁前调用
     */
    PREDESTROY("PreDestroy", "@PreDestroy"),

    /**
     * Bean对象初始化前调用
     */
    POSTCONSTRUCT("PostConstruct", "@PostConstruct"),


    /**
     * 将添加注解的类声明为一个配置类
     */
    CONFIGURATION("Configuration", "@Configuration"),

    /**
     * 用来指定bean对象加载的扫描路径
     */
    COMPONENTSCAN("ComponentScan", "@ComponentScan"),

    /**
     * 延迟初始化一个bean对象
     */
    LAZY("Lazy", "@Lazy"),

    /**
     * 复合注解声明一个controller bean
     */
    RESTCONTROLLER("RestController", "@RestController"),

    /**
     * 用来处理请求地址映射，spring中经常使用
     */
    RequestMapping("RequestMapping", "@RequestMapping");

    private String annotationName;
    private String annotationValue;

    ClassAnnotationEnum(String annotationName, String annotationValue) {
        this.annotationName = annotationName;
        this.annotationValue = annotationValue;
    }

    public String getAnnotationName() {
        return annotationName;
    }

    public void setAnnotationName(String annotationName) {
        this.annotationName = annotationName;
    }

    public String getAnnotationValue() {
        return annotationValue;
    }

    public void setAnnotationValue(String annotationValue) {
        this.annotationValue = annotationValue;
    }

    @Override
    public String value() {

        return annotationValue;
    }
}
